//
//  NSString+Categories.h
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
/*!
 *  url编解码
 */
@interface NSString (Categories)

+ (NSString *)isStringNull:(NSString *)str;

- (NSString *)urlEncodeUTF8String;

- (NSString *)urlDecodeUTF8String;

- (NSURL *)toUrl;

/**
 *  启用URL编码
 *
 */
+ (NSString *)urlEncodeUTF8String:(NSString *)stringText;

/**
 *  URL解码编码
 *
 */
+ (NSString *)urlDecodeUTF8String:(NSString *)stringText;

- (NSString *)utf8ToUnicode;

- (NSString *)replaceUnicode;

/**
 *  MD5
 *
 */
- (NSString *)slMD5;

/**
 *  补充url编码函数(目前只对API参数过滤特殊符号使用，url编码统一使用urlEncodeUTF8String)
 *
 */
+ (NSString *)encodeURL:(NSString *)stringText;


/**
 解析json
 */
- (NSDictionary *)jsonStringToDictionary;

- (NSArray *)jsonStringToArray;

/**
 字符串转 NSURL
*/
- (NSURL *)stringToURL;

-(CGSize)stringSizewithFont:(UIFont *)font maxSize:(CGSize)maxSize;

- (NSString *)autoLanguage;

// 系统时间Unix时间戳(秒)
+ (NSString *)getCurrentSystemDateSecond;

- (NSString *)stampToDateFormatter:(NSString *)formatter;

/// 标准格式时间转换成时间戳
- (NSString *)YMDHmsToStamp;

- (NSString *)ac_timeYMDHms;
- (NSString *)ac_timeYMDHm;
- (NSString *)ac_timeYMDH;
- (NSString *)ac_timeYMD;
- (NSString *)ac_timeYM;
- (NSString *)ac_timeY;
- (NSString *)ac_timeMD;
- (NSString *)ac_timeD;
- (NSString *)ac_timeHms;
- (NSString *)ac_timeHm;
- (NSString *)ac_timeH;


@end
